package co.gov.mintic.Biblioteca.activitys;

import co.gov.mintic.Biblioteca.android.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;

import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.EditText;
import android.widget.Spinner;

public class Filtros extends Activity {

	private String tipobusqueda;
	private String busqueda;

	public void onCreate(Bundle savedInstanceState) {

		super.onCreate(savedInstanceState);
		setContentView(R.layout.filtros);
		Spinner spinner = (Spinner) findViewById(R.id.seleccion);
		ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(
				this, R.array.Tipobusqueda,
				android.R.layout.simple_spinner_item);
		adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
		spinner.setAdapter(adapter);

	}

	public void loadmore(View button) {
		final Spinner spLibros = (Spinner) this.findViewById(R.id.seleccion);
		final EditText textoBusqueda = (EditText) this
				.findViewById(R.id.editText1);

		tipobusqueda = (String) spLibros.getSelectedItem();
		busqueda = textoBusqueda.getText().toString();
		
		Intent intent = new Intent(this, LoadMoreListViewActivity.class);
		intent.putExtra("tbusqueda", tipobusqueda);
		intent.putExtra("busqueda", busqueda);
		this.startActivity(intent);

	}

}
